package com.fs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fs.pojo.Order;
import com.fs.pojo.OrderDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author hyy
 * @version 1.0
 * @description: 销售订单映射层
 * @date 2024/10/15 11:09
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

        /**
         * 销售订单首页表格展示，联系客户，user
         * @return
         */
        List<Order> selectAll(Order order);

    /**
     * 查询所有的订单详情信息
     * @param order
     * @return
     */
    List<Order> getOrderAll(Order order);

        /**
         * 通过销售订单id获取订单相关信息，包括订单详情，客户，销售人员
         * @param id
         * @return
         */
        Order getOrderById(@Param("id") Integer id);

        /**
         * 删除订单详细
         * @param id
         * @return
         */
        Integer delOrderDetails(@Param("id") Integer id);

        /**
         * 删除订单信息
         * @param id
         * @return
         */
        Integer newDeleteById(@Param("id")Integer id);

        Integer addOrder(Order order);

        Integer addOrderDetails(OrderDetails orderDetails);

        Integer updateOrder(Order order);
 }
